<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        //function 函数名(形参2...){}
        //函数名（实参1，实参2，，，）
        function getSum(num1, num2) {
            var sum = num1 + num2;
            console.log(sum);
        }
        getSum(1, 12);

        function getSums(num3, num4) {
            var sum1 = 0;
            for (var i = num3; i <= num4; i++) {
                sum1 += i;
            }
            console.log(sum1);
        }
        getSums(1, 100);
    </script>
</head>

<body>

</body>

</html>